#include "graph.h"
#include "macros.h"
#include "randomize.h"
#include "context.h"
#include "graph_io.h"
#include "partition/partitioner.h"

using namespace mcgpp;

int main(int argc, char **argv){

  if(argc != 7){
    LOG<<argv[1]<<argc;
    ERROREXIT("error! param error!");
  }
  mcgpp::Context::instance().instance_name = argv[1];
  mcgpp::Context::instance().instance_file = argv[2];
  mcgpp::Context::instance().seed_partition_file = argv[3];
  mcgpp::Context::instance().seed = std::atoi(argv[4]);
  mcgpp::Context::instance().run_time = std::atoi(argv[5]);
  mcgpp::Context::instance().coarsen_limit = std::atoi(argv[6]);
  mcgpp::ds::GenericGraph graph(mcgpp::io::createGraphFromFile2(mcgpp::Context::instance().instance_file,2));

  //设置缩合参数
  mcgpp::Context::instance().objMetric = ObjMetric::cut_num;
  //设置总运行时间
  mcgpp::Timer::instance().setTime(mcgpp::Context::instance().run_time);
  //设置随机数种子
  mcgpp::Randomize::instance().setSeed(mcgpp::Context::instance().seed);
//  mcgpp::Partitioner(graph).vcyclePartition();//INHLS
  mcgpp::Partitioner(graph).vcyclePartition4();//INHLS-tabu


  //保存结果
  mcgpp::io::savePartitionFile(graph);
}